home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Communications
/
General
/
LineShare Folder
/
Put Onto Productions Disks
/
Old Scripts
/
ARA 1.0⁄LineShare
/
ARA 1.0_LineShare
next >
Wrap
Text File
|
1993-04-11
|
4KB
|
220 lines
!
! ARA script for connections trough
! a LineShare subPort.
! All modem-specific commands should be moved to the LineShare script.
! So, this ARA script is universal
! We assume that the LineShare script has set the modem to the
! "Direct" mode, if the "CONNECT" message is detected
! (in this case our business is to adjust the serial port speed), or to the
! "Normal" mode, if the "CARRIER" message is detected.
! We don't process the "^2" parameter (speaker), since it's controlled with LineShare
!
@ORIGINATE
@ANSWER
!
! Load Factory configurations (i.e. reset the LineShare emulator),switch off the echo
!
matchclr
matchstr 1 1 "OK\13\10"
write "AT&FE0\13"
matchread 10
jump 59
!
! The modem is ready so enable answering, or originate a call
!
@LABEL 1
matchclr
ifAnswer 2
note "Dialing ^1" 3
write "ATD^1\13"
jump 3
@LABEL 2
matchstr 1 3 "OK\13\10"
write "ATS0=1\13"
matchread 30
jump 59
!
@LABEL 3
matchclr
matchstr 1 6 "CARRIER "
matchstr 2 5 "CONNECT "
matchstr 9 4 "RING\13\10"
matchstr 10 50 "NO CARRIER\13\10"
matchstr 11 50 "ERROR\13\10"
matchstr 12 52 "NO DIALTONE\13\10"
matchstr 13 53 "BUSY\13\10"
matchstr 14 54 "NO ANSWER\13\10"
matchread 800
ifAnswer 2
jump 59
!
@LABEL 4
ifOriginate 3
userhook 1
note "Answering phone…" 2
jump 3
!
! Process the "CONNECT" message - assume that we are in the "Direct" mode
!
@LABEL 5
matchclr
matchstr 2 12 "2400"
matchstr 3 13 "4800"
matchstr 4 14 "7200"
matchstr 5 15 "9600"
matchstr 6 16 "12000"
matchstr 7 17 "14400"
matchstr 8 18 "16800"
matchstr 9 19 "19200"
matchread 10
ifAnswer 2
jump 59
!
! Process the "CARRIER" message - assume that we are in the "Normal" mode
!
@LABEL 6
matchclr
matchstr 2 32 "2400"
matchstr 3 33 "4800"
matchstr 4 34 "7200"
matchstr 5 35 "9600"
matchstr 6 36 "12000"
matchstr 7 37 "14400"
matchstr 8 38 "16800"
matchstr 9 39 "19200"
matchread 10
ifAnswer 2
jump 59
@LABEL 12
note "Communicating at 2400 bps." 2
setspeed 2400
jump 20
!
@LABEL 13
note "Communicating at 4800 bps." 2
setspeed 4800
jump 20
!
@LABEL 14
note "Communicating at 7200 bps." 2
setspeed 7200
jump 20
!
@LABEL 15
note "Communicating at 9600 bps." 2
setspeed 9600
jump 20
!
@LABEL 16
!note "Communicating at 12000 bps." 2
setspeed 12000
jump 20
!
@LABEL 17
note "Communicating at 14400 bps." 2
setspeed 14400
jump 20
!
@LABEL 18
note "Communicating at 16800 bps." 2
setspeed 16800
jump 20
!
@LABEL 19
note "Communicating at 19200 bps." 2
setspeed 19200
jump 20
!
@LABEL 20
ifANSWER 21
pause 30
@LABEL 21
exit 0
!
! CARRIER XXXX processing
!
@LABEL 32
note "Linked at 2400 bps." 2
CommunicatingAT 2400
jump 40
!
@LABEL 33
note "Linked at 4800 bps." 2
CommunicatingAT 4800
jump 40
!
@LABEL 34
note "Linked at 7200 bps." 2
CommunicatingAT 7200
jump 40
!
@LABEL 35
note "Linked at 9600 bps." 2
CommunicatingAT 9600
jump 40
!
@LABEL 36
!note "Linked at 12000 bps." 2
CommunicatingAT 12000
jump 40
!
@LABEL 37
note "Linked at 14400 bps." 2
CommunicatingAT 14400
jump 40
!
@LABEL 38
note "Linked at 16800 bps." 2
CommunicatingAT 16800
jump 40
!
@LABEL 39
note "Linked at 19200 bps." 2
CommunicatingAT 19200
jump 40
!
@LABEL 40
HSReset 0 1 0 0 0 0
ifANSWER 41
pause 30
@LABEL 41
exit 0
!
!
! 50: error messages
! No carrier
@LABEL 50
exit -6021
! No Dial Tone
@LABEL 52
exit -6020
! Busy
@LABEL 53
exit -6022
! No Answer
@LABEL 54
exit -6023
! Modem error
@LABEL 59
exit -6019
!
! Hang up the modem
!
@HANGUP
settries 0
@LABEL 60
DTRClear
pause 2
DTRSet
write "ATZ\13"
matchclr
matchstr 1 62 "OK\13\10"
matchread 30
inctries
iftries 3 62
jump 60
!
@LABEL 62
exit 0